﻿using System;
using Microsoft.EntityFrameworkCore;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using Microsoft.AspNetCore.Identity;
using CRM.Extensions;

namespace CRM.Models
{
    [Table("role")]
    [Comment("角色")]
    public class Role : IdentityRole<int>, IHasTimestamps
    {
        //1超管2管理员3公司管理员4员工(无用户管理)
        [Column("DisplayName"), Comment("展示名称"), Required]
        public string DisplayName { get; set; }

        [Column("rule_id"), Comment("权限组ID"), Required]
        public int RuleId { get; set; } = 0;

        [Column("created_at", TypeName = "Timestamp")]
        public DateTime CreatedAt { get; set; }

        [Column("updated_at", TypeName = "Timestamp")]
        public DateTime UpdatedAt { get; set; }
    }
}
